#include <iostream>
#include <string>
#include <functional>

using std::cout;
using std::endl;
using std::string;
using std::function;

void test()
{
    int number = 100;
    /* auto f = [&number](string name){ */
    function<void(string)> f = [&number](string name){
        cout << "name = " << name << endl;
        ++number;
        cout << "number = " << number << endl;
    };

    f("hello");
    f("world");
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

